<?php

use Illuminate\Database\Seeder;

class FriendsTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $users = \App\Models\User::all();
        $user = $users->where('id',4)->first();
        $user_id = 4;

        $friends = $users->slice(4);
        $friends_id = $friends->pluck('id')->toArray();

        $user->follow($friends_id);

        foreach ($friends as $friend){
            $friend->follow($user_id);
        }

    }
}
